import os, pygame, math
from pygame.locals import *

class Card:
    """The Card class.  Rank, Suit, Position"""
    def __init__(self, rank, suit, showing=False, x=0, y=0):
        ranks = ['a','2','3','4','5','6','7','8','9','t','j','q','k']
        # suits = ['s','c','d','h']

        self.suit = suit
        self.rank = rank
        self.x = x
        self.y = y
        self.showing = showing
        self.ranknum = ranks.index(rank)+1 # Also keep track of numeric rank (non-zero)
        
    def showCard(self):
        self.showing = True

    def hideCard(self):
        self.showing = False

    def getSuit(self):
        return self.suit

    def getRank(self):
        return self.rank
        
    def getRankNum(self):
        return self.ranknum
        
    def getCard(self):
        return (self.rank, self.suit)

    def setCoord(self, x, y):
        self.x = x
        self.y = y

    def getCoord(self):
        return (self.x, self.y)
